package testLayer;

import static org.junit.Assert.*;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import dbLayer.DBCustomer;

public class DBCustomerTest {

	private int 	   id_fail = 0,
					   id_success = 1;
	private String	   name_fail = "Hank Schrader",
					   name_success = "Peter Jensen";
	private DBCustomer dbCustomer;
	
	@Before
	public void setUp() throws Exception {	
		
		this.dbCustomer = new DBCustomer();
		
	}

	@After
	public void tearDown() throws Exception {
	}

	@Test
	public void testFindByIDSuccess() {

		assertTrue(this.dbCustomer.findCustomerID(this.id_success) != null);
		
	}
	
	@Test
	public void testFindByIDFail() {
		
		assertTrue(this.dbCustomer.findCustomerID(this.id_fail) == null);
		
	}
	
	@Test
	public void testFindByNameSuccess() {
		
		assertTrue(this.dbCustomer.findCustomerName(this.name_success) != null);
		
	}
	
	@Test
	public void testFindByNameFail() {
		
		assertTrue(this.dbCustomer.findCustomerName(this.name_fail) == null);
		
	}

}